package advanced.practice._1006;

import java.util.Scanner;

public class Main {

    static char[]nums={'0','1','2','3','4','5','6','7','8','9','A','B','C'};
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String[] line=scanner.nextLine().trim().split(" ");

        StringBuilder builder=new StringBuilder();
        builder.append("#");
        for(String dec :line){
            int val=Integer.parseInt(dec);
            builder.append(nums[val/13]);
            builder.append(nums[val%13]);
        }
        System.out.println(builder.toString());
    }
}
